
//
//  ESUpAndDownButton.m
//  Eyeshot
//
//  Created by admin on 15/7/4.
//  Copyright (c) 2015年 eyeshot. All rights reserved.
//

#import "ESUpAndDownButton.h"

//static UILabel *downLabel;
@implementation ESUpAndDownButton

//+ (id)buttonWithType:(UIButtonType)buttonType
//{
//   ESUpAndDownButton *button = [super buttonWithType:buttonType];
//    if (button) {
//        downLabel = [[UILabel alloc] init];
//        [button addSubview:downLabel];
//        button.adjustsImageWhenDisabled = NO;
//    }
//    return button;
//}


- (UILabel *)downLable
{
    if (_downLable == nil)
    {
        self.downLable = [[UILabel alloc] init];
        [self addSubview:self.downLable];
        

    }
    return _downLable;
}

//- (UILabel *)downLable {
//    if (_downLable == nil) {
//        _downLable = downLabel;
//    }
//    return _downLable;
//}

- (void)setContentColor:(UIColor *)color
{
    self.downLable.textColor = color;
    [self setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
}



- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    
//    self.imageView.frame = CGRectMake(2 * kHorizen, 2 * kHorizen, height - 2 * kHorizen, height - 2 * kHorizen);
//    self.imageView.hidden = NO;
    self.titleLabel.frame = CGRectMake(kHorizen, kHorizen, width - kHorizen * 2, (height - kHorizen * 3)/2);
    self.titleLabel.hidden = NO;
    self.downLable.frame = CGRectMake(kHorizen, height/2 + kHorizen/2, width - kHorizen * 2, (height - kHorizen * 3)/2);
}


@end
